﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace laba_5
{
    public class Calculate
    {
        private int cost_of_all;
        public  Calculate()
        {
            cost_of_all = 0;
        }
       
       public int Calc(int number, int cost,  bool flag)
        {
            if (flag == true)
            {
               cost_of_all = cost;              
            }
           else
                cost_of_all = number * cost;

            return cost_of_all;
        }
    }
}
